//
//  CAShapeLayer.swift
//  Documentation
//
//  Created by Toj on 2/7/23.
//
// 绘制各种图形的图层
// 经常使用UIBezierPath

public struct CAShapeLayerFillRule : Hashable, Equatable, RawRepresentable {

    public init(rawValue: String)
}
public struct CAShapeLayerLineJoin : Hashable, Equatable, RawRepresentable {

    public init(rawValue: String)
}
public struct CAShapeLayerLineCap : Hashable, Equatable, RawRepresentable {

    public init(rawValue: String)
}

/* The shape layer draws a cubic Bezier spline in its coordinate space.
 *
 * The spline is described using a CGPath object and may have both fill
 * and stroke components (in which case the stroke is composited over
 * the fill). The shape as a whole is composited between the layer's
 * contents and its first sublayer.
 *
 * The path object may be animated using any of the concrete subclasses
 * of CAPropertyAnimation. Paths will interpolate as a linear blend of
 * the "on-line" points; "off-line" points may be interpolated
 * non-linearly (e.g. to preserve continuity of the curve's
 * derivative). If the two paths have a different number of control
 * points or segments the results are undefined.
 *
 * The shape will be drawn antialiased, and whenever possible it will
 * be mapped into screen space before being rasterized to preserve
 * resolution independence. (However, certain kinds of image processing
 * operations, e.g. CoreImage filters, applied to the layer or its
 * ancestors may force rasterization in a local coordinate space.)
 *
 * Note: rasterization may favor speed over accuracy, e.g. pixels with
 * multiple intersecting path segments may not give exact results. */

@available(iOS 3.0, *)
open class CAShapeLayer : CALayer {

    
    /* The path defining the shape to be rendered. If the path extends
     * outside the layer bounds it will not automatically be clipped to the
     * layer, only if the normal layer masking rules cause that. Upon
     * assignment the path is copied. Defaults to null. Animatable.
     * (Note that although the path property is animatable, no implicit
     * animation will be created when the property is changed.) */
    
    open var path: CGPath?

    
    /* The color to fill the path, or nil for no fill. Defaults to opaque
     * black. Animatable. */
    
    open var fillColor: CGColor?

    
    /* The fill rule used when filling the path. Options are `non-zero' and
     * `even-odd'. Defaults to `non-zero'. */
    
    open var fillRule: CAShapeLayerFillRule

    
    /* The color to fill the path's stroked outline, or nil for no stroking.
     * Defaults to nil. Animatable. */
    
    open var strokeColor: CGColor?

    
    /* These values define the subregion of the path used to draw the
     * stroked outline. The values must be in the range [0,1] with zero
     * representing the start of the path and one the end. Values in
     * between zero and one are interpolated linearly along the path
     * length. strokeStart defaults to zero and strokeEnd to one. Both are
     * animatable. */
    
    open var strokeStart: CGFloat

    open var strokeEnd: CGFloat

    
    /* The line width used when stroking the path. Defaults to one.
     * Animatable. */
    
    open var lineWidth: CGFloat

    
    /* The miter limit used when stroking the path. Defaults to ten.
     * Animatable. */
    
    open var miterLimit: CGFloat

    
    /* The cap style used when stroking the path. Options are `butt', `round'
     * and `square'. Defaults to `butt'. */
    
    open var lineCap: CAShapeLayerLineCap

    
    /* The join style used when stroking the path. Options are `miter', `round'
     * and `bevel'. Defaults to `miter'. */
    
    open var lineJoin: CAShapeLayerLineJoin

    
    /* The phase of the dashing pattern applied when creating the stroke.
     * Defaults to zero. Animatable. */
    
    open var lineDashPhase: CGFloat

    
    /* The dash pattern (an array of NSNumbers) applied when creating the
     * stroked version of the path. Defaults to nil. */
    
    open var lineDashPattern: [NSNumber]?
}
extension CAShapeLayerFillRule {

    
    @available(iOS 3.0, *)
    public static let nonZero: CAShapeLayerFillRule

    
    @available(iOS 3.0, *)
    public static let evenOdd: CAShapeLayerFillRule
}
extension CAShapeLayerLineJoin {

    
    @available(iOS 3.0, *)
    public static let miter: CAShapeLayerLineJoin

    
    @available(iOS 3.0, *)
    public static let round: CAShapeLayerLineJoin

    
    @available(iOS 3.0, *)
    public static let bevel: CAShapeLayerLineJoin
}
extension CAShapeLayerLineCap {

    
    @available(iOS 3.0, *)
    public static let butt: CAShapeLayerLineCap

    
    @available(iOS 3.0, *)
    public static let round: CAShapeLayerLineCap

    
    @available(iOS 3.0, *)
    public static let square: CAShapeLayerLineCap
}

